//引入样式
require('../../assets/css/normalize.css')
require('../../assets/css/reset.css')
require('./ad.css')


//引入提取模块
let dom = require('../../utils/dom.js')

document.addEventListener("DOMContentLoaded", function () {
    let time = document.querySelector("#time")
    let num = 5;
    setInterval(function () {
        num--;
        time.textContent = num;
        if (num === 0) {
            if (localStorage.getItem('token')) {
                this.location.href = "./index.html"
            } else {
                this.location.href = "./login.html"
            }
        }
    }, 1000)
    dom.get('#a').addEventListener('click', function () {
        if (localStorage.getItem('token')) {
            dom.get('#a').href = "./index.html"
        } else {
            dom.get('#a').href = "./login.html"
        }
    })
})